package lbframework.bean.frame;

import java.awt.Dimension;
import java.awt.Toolkit;

public class LBFrame extends javax.swing.JFrame {

    public LBFrame() throws Exception {
        initComponents();
    }

    protected void centralizarForm() throws Exception {
        Dimension ds = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension dw = this.getSize();

        setLocation((ds.width - dw.width) / 2, (ds.height - dw.height) / 2);
    }

    public void setIcon(String i_resource) throws Exception {
        this.setIconImage(new javax.swing.ImageIcon(getClass().getResource(i_resource)).getImage());
    }

    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
